If you are writing scripts using a real external device, such as an iPhone, you can simulate key events using the SendText(Text) command.
The following keys can be used with the "SendText" command:
For the Home key use {Home}
For deleting text: {BKSP}
For submitting a text field: {ENTER}
For Browser Back button : {WEBBACK}
For unlocking and waking the device : {UNLOCK} or {WAKE}
Toggle orientation:
For landscape: {LANDSCAPE}
For Portrait: {PORTRAIT}